/**
 * @author LKQ
 * @date 2022/2/28 17:03
 * @description 暴力
 */
public class Solution {
    public static void main(String[] args) {

    }
    public int[][] matrixBlockSum(int[][] mat, int k) {
        int m = mat.length, n = mat[0].length;
        int[][] ans = new int[m][n];
        for (int i = 0; i < m; i++) {
            for (int j = 0; j < n; j++) {
                int sum = 0;
                for (int a = 0; a < m; a++) {
                    for (int b = 0; b < n; b++) {
                        if (a >= i - k && a <= i + k && b >= j- k && b <= j + k) {
                            sum += mat[a][b];
                        }
                    }
                }
                ans[i][j] = sum;
            }
        }
        return ans;
    }
}
